{ "cells": [ { "cell_type": "markdown", "source": [ "# Lost in Space\n", "## Problem Description\n", "Will Robinson and his crew are lost in space and have crashed their spaceship in an alien planet. They need to collect metals to repair the engine of their spaceship. More specifically, the piece to repair is made of a metal alloy of chrome, aluminium, and titanium. To build the new piece, Will needs to collect 1 kilogram of chrome, 800 grams of aluminium and 1.5 kilograms of titanium. Will and his crew can gather these metals from 3 different mining locations they have identified around the camp. Will has estimated the average kg/hour that can be extracted in each location:\n", "\n", "\n", "| Mining Location | Chrome (kg/hour) | Aluminium (kg/hour) | Titanium (kg/hour) |\n", "|-----------------|------------------|---------------------|--------------------|\n", "| Location 1 | 0.1 | 0.3 | 0.05 |\n", "| Location 2 | 0.05 | 0.2 | 0.1 |\n", "| Location 3 | 0.02 | 0.15 | 0.2 |\n", "\n", "Write down a Continuous Linear Programming model to minimize the total time used to collect the materials needed to build the part needed to fix the engine.\n", "\n", "**Decision Variables:**\n", "\n", "Let $x_1$, $x_2$, and $x_3$ be the number of hours spent in each location (1, 2, and 3) respectively. $x_1$, $x_2$, and $x_3$ are continuous variables (non-negative real numbers).\n", "\n", "**Objective Function:**\n", "\n", "Minimize the total time spent collecting the materials:\n", "\n", "$\\min z = x_1 + x_2 + x_3$\n", "\n", "**Constraints:**\n", "Ensure that the amount of each metal collected is enough to build the part needed to fix the engine:\n", "\n", "- Chrome (kg):\n", "\n", "$0.1x_1 + 0.05x_2 + 0.02x_3 \\geq 1$\n", "\n", "- Aluminium (Kg):\n", "\n", "$0.3x_1 + 0.2x_2 + 0.15x_3 \\geq 0.8$\n", "\n", "- Titanium (Kg):\n", "\n", "$0.05x_1 + 0.1x_2 + 0.2x_3 \\geq 1.5$\n", "\n", "Likewise, we could define the matrix $A$ containing the coefficients of the constraints and the vector $b$ containing the right-hand side of the constraints, and the vector $c$ containing the coefficients of the objective function as follows:\n", "\n", "$A = \\begin{bmatrix} 0.1 & 0.05 & 0.02 \\\\ 0.3 & 0.2 & 0.15 \\\\ 0.05 & 0.1 & 0.2 \\end{bmatrix}$\n", "\n", "$b = \\begin{bmatrix} 1 \\\\ 0.8 \\\\ 1.5 \\end{bmatrix}$\n", "\n", "$c = \\begin{bmatrix} 1 \\\\ 1 \\\\ 1 \\end{bmatrix}$\n", "\n", "\n", "The problem model can be written as:\n", "\n", "$\\min z = c^Tx$\n", "\n", "subject to:\n", "\n", "$Ax \\geq b$\n", "\n", "Where $x = \\begin{bmatrix} x_1 \\\\ x_2 \\\\ x_3 \\end{bmatrix}$\n" ], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 2 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython2", "version": "2.7.6" } }, "nbformat": 4, "nbformat_minor": 0 }